#include<cmath>
value round floor ceil trunc
----- ----- ----- ---- -----
2.3 2.0 2.0 3.0 2.0
3.8 4.0 3.0 4.0 3.0
5.5 6.0 5.0 6.0 5.0
-2.3 -2.0 -3.0 -2.0 -2.0
-3.8 -4.0 -4.0 -3.0 -3.0
-5.5 -6.0 -6.0 -5.0 -5.0
四舍五入取整round、向下取整 floor、向上取整 ceil和去除小数点取整trunc C++
最新推荐文章于 2024-04-11 22:47:59 发布